public class TrianglePattern {
    public static void main(String[] args) {
        int rows = 10;
        printTriangle1(rows);
        System.out.println("--------------------------我是华丽的分界线--------------------------");
        printTriangle2(rows);
    }

    // 打印第一个三角形
    public static void printTriangle1(int rows) {
        for (int i = 1; i <= rows; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    // 打印第二个三角形
    public static void printTriangle2(int rows) {
        for (int i = rows; i >= 1; i--) {
            for (int j = 1; j <= i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}

